#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 5e6 + 5;
const int B = 131;

int n, m;
string s;
ull f[N], g[N];
ull b[N];
int dp[N];

void init() {
  n = s.size();
  s = ' ' + s;
  b[0] = 1;
  rep(i, 1, n) {
    f[i] = f[i - 1] * B + s[i];
    b[i] = b[i - 1] * B;
  }
  per(i, n, 1) { g[i] = g[i + 1] * B + s[i]; }
}
bool check(int len) {
  ull x = f[len];
  ull y = g[1] - g[len + 1] * b[len];
  return x == y;
}

void solve() {
  cin >> s;
  init();
  ll ans = 0;
  rep(i, 1, n) {
    if (!check(i))
      dp[i] = 0;
    else
      dp[i] = dp[i / 2] + 1;
    ans += dp[i];
  }
  cout << ans;
  return;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}